/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-03-23
 * Time: 11:57
 */
class Parent {
    public Parent() {
        func(); // 父类构造方法中调用可重写方法
    }

    public void func() {
        System.out.println("Parent.func()");
    }
}

class Child extends Parent {
    private int value = 10; // 子类成员变量初始化

    @Override
    public void func() {
        System.out.println("Child.func() " + value); // 访问未初始化的 value
    }
}
